package com.caigou.component;

import com.caigou.bean.cms.entity.*;
import com.caigou.bean.cms.template.ArticleKeywordTemplate;
import com.caigou.bean.cms.template.ChannelDataTemplate;
import com.caigou.bean.vo.ChannelTdkVO;
import com.caigou.mapper.cms.*;
import com.caigou.pojo.ArticleAudioData;
import com.caigou.pojo.ArticleBookData;
import com.caigou.pojo.ArticleProductData;
import com.caigou.pojo.ChannelOtherConfigData;
import com.caigou.service.FooterConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 模板静态资源生成处理的工具类，处理所有的频道首页
 */

@Slf4j
@Component
public class HtmlHomePageBuilderComponent {

    @Resource
    private TemplateComponent templateComponent;// 模板处理类
    @Resource
    private ChannelMapper channelMapper;// 频道mapper
    @Resource
    private ChannelDataMapper channelDataMapper;// 频道数据mapper
    @Resource
    private ChannelHotSearchMapper channelHotSearchMapper;// 热搜数据mapper
    @Resource
    private ArticleTitleMapper articleTitleMapper;// 文章标题列表mapper
    @Resource
    private ArticleKeywordMapper articleKeywordMapper;// 文章关键字列表mapper
    @Resource
    private ArticleProductMapper articleProductMapper;// 文章产品信息表mapper
    @Resource
    private ArticleBookMapper articleBookMapper;// 文章图书信息表mapper
    @Resource
    private ArticleAudioMapper articleAudioMapper;
    @Resource
    private FooterConfigService footerConfigService;
    @Value("${domain}")
    private String domain;// 站点域名
    @Value("${domainJunDui}")
    private String domainJunDui;
    @Value("${domainQiChe}")
    private String domainQiChe;
    @Value("${domainIT}")
    private String domainIT;
    @Value("${domainKongTiao}")
    private String domainKongTiao;
    @Value("${domainDianTi}")
    private String domainDianTi;
    @Value("${domainJiaJu}")
    private String domainJiaJu;
    @Value("${yzb.domain}")
    private String yzbDomain;// 易找标网站域名
    @Value("${domainHuBei}")
    private String domainHuBei;// 易找标网站域名
    @Value("${domainHeNan}")
    private String domainHeNan;// 易找标网站域名
    @Value("${domainLiaoNing}")
    private String domainLiaoNing;// 易找标网站域名
    @Value("${domainFuJian}")
    private String domainFuJian;// 易找标网站域名
    @Value("${domainHaiNan}")
    private String domainHaiNan;// 易找标网站域名
    @Value("${domainHeBei}")
    private String domainHeBei;// 河北
    @Value("${domainShanDong}")
    private String domainShanDong;// 山东
    @Value("${domainJiangSu}")
    private String domainJiangSu;// 江苏
    @Value("${domainShaanXi}")
    private String domainShaanXi;// 陕西
    @Value("${domainBeiJing}")
    private String domainBeiJing;// 北京
    @Value("${domainZheJiang}")
    private String domainZheJiang;// 浙江
    @Value("${domainYunNan}")
    private String domainYunNan;// 云南
    @Value("${domainGuiZhou}")
    private String domainGuiZhou;// 贵州
    @Value("${domainChongQing}")
    private String domainChongQing;// 重庆
    @Value("${domainTianJin}")
    private String domainTianJin;// 天津
    @Value("${domainShenZhen}")
    private String domainShenZhen;// 深圳
    @Value("${domainQingDao}")
    private String domainQingDao;// 青岛
    @Value("${domainDaLian}")
    private String domainDaLian;// 大连
    @Value("${domainXiZang}")
    private String domainXiZang;// 西藏
    @Value("${domainXinJiang}")
    private String domainXinJiang;// 新疆
    @Value("${domainNingXia}")
    private String domainNingXia;// 宁夏
    @Value("${domainGuangXi}")
    private String domainGuangXi;// 广西
    @Value("${domainNeiMengGu}")
    private String domainNeiMengGu;// 内蒙古
    @Value("${domainGanSu}")
    private String domainGanSu;// 甘肃
    @Value("${domainBingTuan}")
    private String domainBingTuan;// 新疆生产建设兵团

    // 频道推送修改--更新静态页(碎片)数据
    public String buildHomePageHtml(String plateId){
        // 模板生成处理
        String templateCode = "";// 模板编号
        Map<String, Object> map = new HashMap<>();// 模板数据
        switch (plateId){
            // 全局处理
            case "100010101":// 精品好书
                templateCode = "PUBLICFRAGMENTBOOKS";
                map = disposeTemplateMap(1,"100010101",null,null,null);
                break;
            case "100010201":// 亚利聊政采
                templateCode = "PUBLICFRAGMENTAUDIO";
                map = disposeTemplateMap(1,"100010201" ,null,null,null);
                break;
            case "100010301":// 视频课堂
                templateCode = "PUBLICFRAGMENTVIDEO";
                map = disposeTemplateMap(1,"100010301",null,null,null);
                break;
            case "100010401":// 集采年会
            case "100010402":// 监管峰会
                log.info("修改集采年会、监管峰会");
                break;
            case "100010701":// 左侧边栏易采通LOGO(首页)
            case "100010702":// 左侧边栏易采通LOGO(首页)
            case "100010801":// 左侧边栏易考通LOGO(首页)
            case "100010901":// 左侧边栏易找标LOGO(首页)
                templateCode = "HOMEFRAGMENTLOGO";
                List<String> homeLogo = new ArrayList<>();
                homeLogo.add("100010701");
                homeLogo.add("100010702");
                homeLogo.add("100010801");
                homeLogo.add("100010901");
                map = disposeTemplateMap(4,null,homeLogo,null,null);
                break;
            // 网站首页处理
            case "101010101":// 要闻
            case "101010102":// 采购人
            case "101010103":// 实务
            case "101010104":// 监管
            case "101010105":// 军队
            case "101010106":// 研究院
                templateCode = "HOMEFRAGMENTINPORTANTNEWS";
                List<String> home = new ArrayList<>();
                home.add("101010101");
                home.add("101010102");
                home.add("101010103");
                home.add("101010104");
                home.add("101010105");
                home.add("101010106");
                map = disposeTemplateMap(4,null,home,null,null);
                break;
            case "101010201":// 易采通精品课
                templateCode = "HOMEFRAGMENTEXCELLENTCOURSE";
                map = disposeTemplateMap(3,plateId,null,null,null);
                break;
            case "101010202":// 列表展示
                templateCode = "HOMEFRAGMENTLIST";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "101010301":// 图表数据
                templateCode = "HOMEFRAGMENTCHART";
                map = disposeTemplateMap(2,plateId,null,null,null);
                break;
            case "101010401":// 汽车
            case "101010402":// IT
            case "101010403":// 家具
            case "101010404":// 空调电器
            case "101010405":// 电梯
                templateCode = "HOMEFRAGMENTTMT";
                List<String> homeList = new ArrayList<>();
                homeList.add("101010401");
                homeList.add("101010402");
                homeList.add("101010403");
                homeList.add("101010404");
                homeList.add("101010405");
                map = disposeTemplateMap(4,null,homeList,null,null);
                break;
            case "101010501":// 正福易考通
                templateCode = "HOMEFRAGMENTEXAM";
                map = disposeTemplateMap(3,plateId,null,null,null);
                break;
            case "101020101":// 首页轮播图
                templateCode = "HOMEFRAGMENTREBANNER";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "101020102":// 首页主推荐位
                templateCode = "HOMEFRAGMENTRECOMMEND";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "101020201":// 热点专题
                templateCode = "HOMEFRAGMENTHOTTOPIC";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "101020301":// 热点排行
                templateCode = "HOMEFRAGMENTHOTSPOT";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "101020401":// 有问有答
                templateCode = "HOMEFRAGMENTQUESTION";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "101020501":// 人物观点（监管/监管资讯/重要资讯/人物观点）
                templateCode = "HOMEFRAGMENTEXPERT";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            // 采购人频道处理
            case "102010101":// 采购人
                templateCode = "PURCHASERFRAGMENTPROCURSLIST";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "102010102":// 意向公开
                templateCode = "PURCHASERFRAGMENTINTENTION";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "102010201":// 高校院所
                templateCode = "PURCHASERFRAGMENTSCHOOL";
                map = disposeTemplateMap(3,plateId,null,null,null);
                break;
            case "102010202":// 列表展示
                templateCode = "PURCHASERFRAGMENTSCHOOLLIST";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "102010203":// 推荐专题
                templateCode = "PURCHASERFRAGMENTRECOMMENDSPECIAL";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "102010301":// 采购文件
            case "102010302":// 采购合同
            case "102010303":// 采购需求
            case "102010304":// 履约验收
            case "102010305":// 内控制度
                templateCode = "PURCHASERFRAGMENTRECOMMENDLIST";
                List<String> purchaserTabList = new ArrayList<>();
                purchaserTabList.add("102010301");
                purchaserTabList.add("102010302");
                purchaserTabList.add("102010303");
                purchaserTabList.add("102010304");
                purchaserTabList.add("102010305");
                map = disposeTemplateMap(4,null,purchaserTabList,null,null);
                break;
            case "102020101":// 频道首页轮播
                templateCode = "PURCHASERFRAGMENTBANNER";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "102020102":// 主推荐位
                templateCode = "PURCHASERFRAGMENTRECOMMEND";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "102020201":// 热点专题
                templateCode = "PURCHASERFRAGMENTHOTTOPIC";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "102020301":// 热点排行
                templateCode = "PURCHASERFRAGMENTHOTSPOT";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            // 采购实务频道处理
            case "103010101":// 案例点评
                templateCode = "PRACTICEFRAGMENTCASEREVIEW";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "103010102":// 精品项目
                templateCode = "PRACTICEFRAGMENTBOUTIQUEPROJECT";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "103010201":// 亚利说采购
                templateCode = "PRACTICEFRAGMENTPURCHASE";
                map = disposeTemplateMap(3,plateId,null,null,null);
                break;
            case "103010202":// 实务热搜
                templateCode = "PRACTICEFRAGMENTPRACTICEHOTSEARCH";
                map = disposeTemplateMap(5,plateId,null,null,null);
                break;
            case "103010301":// 采购范本
            case "103010302":// 需求标准
            case "103010303":// 实务流程
            case "103010304":// 内控管理
            case "103010305":// 采购/交易中心
            case "103010306":// 社会中介
                templateCode = "PRACTICEFRAGMENTTABLIST";
                List<String> practiceTabList = new ArrayList<>();
                practiceTabList.add("103010301");
                practiceTabList.add("103010302");
                practiceTabList.add("103010303");
                practiceTabList.add("103010304");
                practiceTabList.add("103010305");
                practiceTabList.add("103010306");
                map = disposeTemplateMap(4,null,practiceTabList,null,null);
                break;
            case "103020101":// 首页轮播
                templateCode = "PRACTICEFRAGMENTBANNER";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "103020102":// 主推荐位
                templateCode = "PRACTICEFRAGMENTBANNERRECOMMEND";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "103020201":// 热点专题
                templateCode = "PRACTICEFRAGMENTBOUTIQUE";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "103020301":// 热搜榜
                templateCode = "PRACTICEFRAGMENTHOTSEARCH";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            // 监管频道处理
            case "104010101":// 政策发布
                templateCode = "SUPERVISEFRAGMENTPOLICYRELEASE";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "104010102":// 人物观点
                templateCode = "SUPERVISEFRAGMENTVIEWPOINT";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "104010201":// 新规解读
                templateCode = "SUPERVISEFRAGMENTSTIPULATIONUNSCRAMBLE";
                map = disposeTemplateMap(2,plateId,null,null,null);
                break;
            case "104010202":// 推荐专题
                templateCode = "SUPERVISEFRAGMENTRECOMMENDSPECIAL";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "104010301":// 法律法规
            case "104010302":// 地方法规
            case "104010303":// 投诉处理
            case "104010304":// 监督检查
            case "104010305":// 黑名单
                templateCode = "SUPERVISEFRAGMENTTABLIST";
                List<String> superviseTabList = new ArrayList<>();
                superviseTabList.add("104010301");
                superviseTabList.add("104010302");
                superviseTabList.add("104010303");
                superviseTabList.add("104010304");
                superviseTabList.add("104010305");
                map = disposeTemplateMap(4,null,superviseTabList,null,null);
                break;
            case "104020101":// 首页轮播
                templateCode = "SUPERVISEFRAGMENTBANNER";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "104020102":// 主推荐位
                templateCode = "SUPERVISEFRAGMENTBANNERRECOMMEND";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "104020201":// 热点专题
                templateCode = "SUPERVISEFRAGMENTBOUTIQUE";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "104020301":// 热点排行
                templateCode = "SUPERVISEFRAGMENTHOTSEARCH";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            // 研究院频道处理
            case "105010101":// 热点难点
                templateCode = "INSTITUTEFRAGMENTHOTDIFFICULTY";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "105010102":// 智库专家
                templateCode = "INSTITUTEFRAGMENTEXPERT";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "105010201":// 政采大数据
                templateCode = "INSTITUTEFRAGMENTBIGDATA";
                map = disposeTemplateMap(2,plateId,null,null,null);
                break;
            case "105010202":// 热词解析
                templateCode = "INSTITUTEFRAGMENTHOTWORDS";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "105010301":// 工程采购
            case "105010302":// PPP
            case "105010303":// 服务采购
            case "105010304":// 购买服务
            case "105010305":// 聚焦GPA
            case "105010306":// 国外法规
                templateCode = "INSTITUTEFRAGMENTTABLIST";
                List<String> instituteTabList = new ArrayList<>();
                instituteTabList.add("105010301");
                instituteTabList.add("105010302");
                instituteTabList.add("105010303");
                instituteTabList.add("105010304");
                instituteTabList.add("105010305");
                instituteTabList.add("105010306");
                map = disposeTemplateMap(4,null,instituteTabList,null,null);
                break;
            case "105020101":// 研究院首页轮播
                templateCode = "INSTITUTEFRAGMENTBANNER";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "105020102":// 主推荐位
                templateCode = "INSTITUTEFRAGMENTBANNERRECOMMEND";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "105020201":// 热点专题
                templateCode = "INSTITUTEFRAGMENTBOUIQUE";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "105020301":// 热点排行
                templateCode = "INSTITUTEFRAGMENTHOTSEARCH";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            // 军队频道处理
            case "106010101":// 政策解读
                templateCode = "ARMYFRAGMENTPOLICY";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "106010102":// 军队标讯
                templateCode = "ARMYFRAGMENTSIGNS";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "106010201":// 专题
                templateCode = "ARMYFRAGMENTSPECIAL";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "106010202":// 资讯
                templateCode = "ARMYFRAGMENTINFORMATION";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "106010203":// VR全景
                templateCode = "ARMYFRAGMENTVR";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "106020101":// 首页轮播
                templateCode = "ARMYFRAGMENTBANNER";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "106020102":// 主推荐位
                templateCode = "ARMYFRAGMENTRECOMMEND";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "106020201":// 热点专题
                templateCode = "ARMYFRAGMENTHOTTOPIC";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "106020301":// 热点排行
                templateCode = "ARMYFRAGMENTHOTSEARCH";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            // 汽车频道处理
            case "107010101":// 要闻
            case "107010102":// 专题
            case "107010103":// 政策
            case "107010104":// 解读
            case "107010105":// 黑名单
                templateCode = "AUTOFRAGMENTIMPORTANTNEWS";
                List<String> auto = new ArrayList<>();
                auto.add("107010101");
                auto.add("107010102");
                auto.add("107010103");
                auto.add("107010104");
                auto.add("107010105");
                map = disposeTemplateMap(4,null, auto,null,null);
                break;
            case "107010201":// 图表数据
                templateCode = "AUTOFRAGMENTCHART";
                map = disposeTemplateMap(2,plateId,null,null,null);
                break;
            case "107010301":// 新车上市
            case "107010302":// 图例展示
            case "107010303":// 列表展示
                templateCode = "AUTOFRAGMENTNEWPRODUCT";
                // 新品推荐列表
                Map autoMap1 = disposeTemplateMap(1,"107010301",null,null,null);
                map.put("list1",autoMap1.get("list"));
                map.put("channel1",autoMap1.get("channel"));
                // 图例展示列表
                Map autoMap2 = disposeTemplateMap(3,"107010302",null,null,null);
                map.put("list2",autoMap2.get("list"));
                map.put("channel2",autoMap2.get("channel"));
                // 列表展示列表
                Map autoMap3 = disposeTemplateMap(1,"107010303",null,null,null);
                map.put("list3",autoMap3.get("list"));
                map.put("channel3",autoMap3.get("channel"));

                map.put("domain",domain);
                break;
            case "107020101":// 频道首页轮播
                templateCode = "AUTOFRAGMENTBANNER";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "107020201":// 好车汇(好车汇)
                templateCode = "AUTOFRAGMENTEVALUATING";
                // 评优评测内容只能使用产品类型文章(type=7)获取产品信息
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "107020301":// 主播荐车
                templateCode = "AUTOFRAGMENTBOUTIQUE";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "107020401":// 今日车讯（不携带数据--直接更新碎片(读取数量)）
                templateCode = "AUTOFRAGMENTINFORMATION";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "107020501":// 大标推荐（不携带数据--直接更新碎片(读取数量)）
                templateCode = "AUTOFRAGMENTRECOMMENDINFORMATION";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "107020601":// 热搜榜（不携带数据--直接更新碎片(读取数量)）
                templateCode = "AUTOFRAGMENTTOPSEARCH";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;

            // IT频道处理
            case "108010101":// 要闻
            case "108010102":// 专题
            case "108010103":// 政策
            case "108010104":// 解读
            case "108010105":// 黑名单
                templateCode = "ITFRAGMENTIMPORTANTNEWS";
                List<String> it = new ArrayList<>();
                it.add("108010101");
                it.add("108010102");
                it.add("108010103");
                it.add("108010104");
                it.add("108010105");
                map = disposeTemplateMap(4,null, it,null,null);
                break;
            case "108010201":// 图表数据
                templateCode = "ITFRAGMENTCHART";
                map = disposeTemplateMap(2,plateId,null,null,null);
                break;
            case "108010301":// 新品推荐
            case "108010302":// 图例展示
            case "108010303":// 列表展示
                templateCode = "ITFRAGMENTNEWPRODUCT";
                // 新品推荐列表
                Map itMap1 = disposeTemplateMap(1,"108010301",null,null,null);
                map.put("list1",itMap1.get("list"));
                map.put("channel1",itMap1.get("channel"));
                // 图例展示列表
                Map itMap2 = disposeTemplateMap(3,"108010302",null,null,null);
                map.put("list2",itMap2.get("list"));
                map.put("channel2",itMap2.get("channel"));
                // 列表展示列表
                Map itMap3 = disposeTemplateMap(1,"108010303",null,null,null);
                map.put("list3",itMap3.get("list"));
                map.put("channel3",itMap3.get("channel"));

                map.put("domain",domain);
                break;
            case "108020101":// 频道首页轮播
                templateCode = "ITFRAGMENTBANNER";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "108020201":// 评优评测
                templateCode = "ITFRAGMENTEVALUATING";
                // 评优评测内容只能使用产品类型文章(type=7)获取产品信息
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "108020301":// 精品店
                templateCode = "ITFRAGMENTBOUTIQUE";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "108020401":// 今日标讯（不携带数据--直接更新碎片(读取数量)）
                templateCode = "ITFRAGMENTINFORMATION";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "108020501":// 大标推荐（不携带数据--直接更新碎片(读取数量)）
                templateCode = "ITFRAGMENTRECOMMENDINFORMATION";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "108020601":// 热搜榜（不携带数据--直接更新碎片(读取数量)）
                templateCode = "ITFRAGMENTTOPSEARCH";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;

            // 电梯频道处理
            case "109010101":// 要闻
            case "109010102":// 专题
            case "109010103":// 政策
            case "109010104":// 解读
            case "109010105":// 黑名单
                // 要闻、专题、政策、解读、黑名单(在同一个模板中，规则使用同一个)
                templateCode = "ELEVATORFRAGMENTIMPORTANTNEWS";
                // 频道页卡数据
                List<String> elevator = new ArrayList<>();
                elevator.add("109010101");
                elevator.add("109010102");
                elevator.add("109010103");
                elevator.add("109010104");
                elevator.add("109010105");
                map = disposeTemplateMap(4,null, elevator,null,null);
                break;
            case "109010201":// 图表数据
                templateCode = "ELEVATORFRAGMENTCHART";
                map = disposeTemplateMap(2,plateId,null,null,null);
                break;
            case "109010301":// 新品推荐
            case "109010302":// 图例展示
            case "109010303":// 列表展示
                // 新品推荐、图例展示、列表展示在同一个模板中，因此统一处理
                templateCode = "ELEVATORFRAGMENTNEWPRODUCT";
                // 新品推荐列表
                Map elevatorMap1 = disposeTemplateMap(1,"109010301",null,null,null);
                map.put("list1",elevatorMap1.get("list"));
                map.put("channel1",elevatorMap1.get("channel"));
                // 图例展示列表
                Map elevatorMap2 = disposeTemplateMap(3,"109010302",null,null,null);
                map.put("list2",elevatorMap2.get("list"));
                map.put("channel2",elevatorMap2.get("channel"));
                // 列表展示列表
                Map elevatorMap3 = disposeTemplateMap(1,"109010303",null,null,null);
                map.put("list3",elevatorMap3.get("list"));
                map.put("channel3",elevatorMap3.get("channel"));

                map.put("domain",domain);
                break;
            case "109020101":// 频道首页轮播
                templateCode = "ELEVATORFRAGMENTBANNER";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "109020201":// 评优评测
                templateCode = "ELEVATORFRAGMENTEVALUATING";
                // 评优评测内容只能使用产品类型文章(type=7)获取产品信息
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "109020301":// 精品店
                templateCode = "ELEVATORFRAGMENTBOUTIQUE";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "109020401":// 今日标讯（不携带数据--直接更新碎片(读取数量)）
                templateCode = "ELEVATORFRAGMENTINFORMATION";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "109020501":// 大标推荐（不携带数据--直接更新碎片(读取数量)）
                templateCode = "ELEVATORFRAGMENTRECOMMENDINFORMATION";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "109020601":// 热搜榜（不携带数据--直接更新碎片(读取数量)）
                templateCode = "ELEVATORFRAGMENTTOPSEARCH";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;

            // 空调频道处理
            case "110010101":// 要闻
            case "110010102":// 专题
            case "110010103":// 政策
            case "110010104":// 解读
            case "110010105":// 黑名单
                // 要闻、专题、政策、解读、黑名单(在同一个模板中，规则使用同一个)
                templateCode = "CONDITIONERFRAGMENTIMPORTANTNEWS";
                // 频道页卡数据
                List<String> conditioner = new ArrayList<>();
                conditioner.add("110010101");
                conditioner.add("110010102");
                conditioner.add("110010103");
                conditioner.add("110010104");
                conditioner.add("110010105");
                map = disposeTemplateMap(4,null, conditioner,null,null);
                break;
            case "110010201":// 图表数据
                templateCode = "CONDITIONERFRAGMENTCHART";
                map = disposeTemplateMap(2,plateId,null,null,null);
                break;
            case "110010301":// 新品推荐
            case "110010302":// 图例展示
            case "110010303":// 列表推荐
                // 新品推荐、图例展示、列表展示在同一个模板中，因此统一处理
                templateCode = "CONDITIONERFRAGMENTNEWPRODUCT";
                // 新品推荐列表
                Map conditionerMap1 = disposeTemplateMap(1,"110010301",null,null,null);
                map.put("list1",conditionerMap1.get("list"));
                map.put("channel1",conditionerMap1.get("channel"));
                // 图例展示列表
                Map conditionerMap2 = disposeTemplateMap(3,"110010302",null,null,null);
                map.put("list2",conditionerMap2.get("list"));
                map.put("channel2",conditionerMap2.get("channel"));
                // 列表展示列表
                Map conditionerMap3 = disposeTemplateMap(1,"110010303",null,null,null);
                map.put("list3",conditionerMap3.get("list"));
                map.put("channel3",conditionerMap3.get("channel"));

                map.put("domain",domain);
                break;
            case "110020101":// 频道首页轮播
                templateCode = "CONDITIONERFRAGMENTBANNER";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "110020201":// 评优评测
                templateCode = "CONDITIONERFRAGMENTEVALUATING";
                // 评优评测内容只能使用产品类型文章(type=7)获取产品信息
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "110020301":// 精品店
                templateCode = "CONDITIONERFRAGMENTBOUTIQUE";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "110020401":// 今日标讯（不携带数据--直接更新碎片(读取数量)）
                templateCode = "CONDITIONERFRAGMENTINFORMATION";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "110020501":// 大标推荐（不携带数据--直接更新碎片(读取数量)）
                templateCode = "CONDITIONERFRAGMENTRECOMMENDINFORMATION";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "110020601":// 热搜榜（不携带数据--直接更新碎片(读取数量)）
                templateCode = "CONDITIONERFRAGMENTTOPSEARCH";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            // 家具频道处理
            case "111010101":// 要闻
            case "111010102":// 专题
            case "111010103":// 政策
            case "111010104":// 解读
            case "111010105":// 黑名单
                // 要闻、专题、政策、解读、黑名单(在同一个模板中，规则使用同一个)
                templateCode = "FURNITUREFRAGMENTIMPORTANTNEWS";
                // 频道页卡数据
                List<String> furniture = new ArrayList<>();
                furniture.add("111010101");
                furniture.add("111010102");
                furniture.add("111010103");
                furniture.add("111010104");
                furniture.add("111010105");
                map = disposeTemplateMap(4,null, furniture,null,null);
                break;
            case "111010201":// 图表数据
                templateCode = "FURNITUREFRAGMENTCHART";
                map = disposeTemplateMap(2,plateId,null,null,null);
                break;
            case "111010301":// 新品推荐
            case "111010302":// 图例展示
            case "111010303":// 列表展示
                // 新品推荐、图例展示、列表展示在同一个模板中，因此统一处理
                templateCode = "FURNITUREFRAGMENTNEWPRODUCT";
                // 新品推荐列表
                Map furnitureMap1 = disposeTemplateMap(1,"111010301",null,null,null);
                map.put("list1",furnitureMap1.get("list"));
                map.put("channel1",furnitureMap1.get("channel"));
                // 图例展示列表
                Map furnitureMap2 = disposeTemplateMap(3,"111010302",null,null,null);
                map.put("list2",furnitureMap2.get("list"));
                map.put("channel2",furnitureMap2.get("channel"));
                // 列表展示列表
                Map furnitureMap3 = disposeTemplateMap(1,"111010303",null,null,null);
                map.put("list3",furnitureMap3.get("list"));
                map.put("channel3",furnitureMap3.get("channel"));

                map.put("domain",domain);
                break;
            case "111020101":// 频道首页轮播
                templateCode = "FURNITUREFRAGMENTBANNER";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "111020201":// 评优评测
                templateCode = "FURNITUREFRAGMENTEVALUATING";
                // 评优评测内容只能使用产品类型文章(type=7)获取产品信息
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "111020301":// 精品店
                templateCode = "FURNITUREFRAGMENTBOUTIQUE";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "111020401":// 今日标讯（不携带数据--直接更新碎片(读取数量)）
                templateCode = "FURNITUREFRAGMENTINFORMATION";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "111020501":// 大标推荐（不携带数据--直接更新碎片(读取数量)）
                templateCode = "FURNITUREFRAGMENTRECOMMENDINFORMATION";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            case "111020601":// 热搜榜（不携带数据--直接更新碎片(读取数量)）
                templateCode = "FURNITUREFRAGMENTTOPSEARCH";
                map = disposeTemplateMap(1,plateId,null,null,null);
                break;
            // 分站
            case "201010101":// 河北--通知公告
            case "201010102":// 河北--协议供货批量采购
            case "201010103":// 河北--易找标
            case "201010104":// 河北--国家法规
            case "201010105":// 河北--地方法规
            case "201010106":// 河北--监督检查处理结果
            case "201010107":// 河北--投诉处理结果
            case "201010108":// 河北--办事指南
            case "201010109":// 河北--常见问题解答
            case "201010110":// 河北--文件下载
                templateCode = "HEBEI";
                List<String> hebeiList = new ArrayList<>();
                Map<String, String> hebeiChangeList = new HashMap<>();
                hebeiList.add("201010101");
                hebeiList.add("201010102");
                hebeiList.add("201010103");
                hebeiList.add("201010104");
                hebeiChangeList.put("201010104", "104010301");
                hebeiList.add("201010105");
                hebeiList.add("201010106");
                hebeiList.add("201010107");
                hebeiList.add("201010108");
                hebeiList.add("201010109");
                hebeiList.add("201010110");
                map = disposeTemplateMap(6,null,null,hebeiList,hebeiChangeList);
                String hebeiUrl = null;
                // 进行静态页生成方法调用
                try {
                    hebeiUrl = templateComponent.createHtml3(templateCode, map);
                    log.info("静态文件生成成功，生成地址是={}", hebeiUrl);
                } catch (IOException e){
                    log.error("静态文件生成失败，失败原因是={}", e.getMessage());
                }
                return hebeiUrl;
            case "301010101":// 河南--通知公告
            case "301010102":// 河南--工作动态
            case "301010103":// 河南--易找标
            case "301010104":// 河南--国家法规(监管--法律法规)
            case "301010105":// 河南--地方法规
            case "301010106":// 河南--政策专区
            case "301010107":// 河南--投诉处理结果
            case "301010108":// 河南--监督检查处理结果
            case "301010109":// 河南--集中采购机构考核结果
            case "301010110":// 河南--购买服务
            case "301010111":// 河南--办事指南
            case "301010112":// 河南--文件下载
                templateCode = "HENAN";
                List<String> henanList = new ArrayList<>();
                Map<String, String> henanChangeList = new HashMap<>();
                henanList.add("301010101");
                henanList.add("301010102");
                henanList.add("301010103");
                henanList.add("301010104");
                henanChangeList.put("301010104", "104010301");
                henanList.add("301010105");
                henanList.add("301010106");
                henanList.add("301010107");
                henanList.add("301010108");
                henanList.add("301010109");
                henanList.add("301010110");
                henanList.add("301010111");
                henanList.add("301010112");
                map = disposeTemplateMap(6,null,null,henanList,henanChangeList);
                String henanUrl = null;
                // 进行静态页生成方法调用
                try {
                    henanUrl = templateComponent.createHtml3(templateCode, map);
                    log.info("静态文件生成成功，生成地址是={}", henanUrl);
                } catch (IOException e){
                    log.error("静态文件生成失败，失败原因是={}", e.getMessage());
                }
                return henanUrl;
            case "401010101":// 山东--通知公告
            case "401010102":// 山东--工作动态
            case "401010103":// 山东--易找标
            case "401010104":// 山东--国家法规
            case "401010105":// 山东--地方法规
            case "401010106":// 山东--投诉处理结果
            case "401010107":// 山东--监督检查处理结果
            case "401010108":// 山东--购买服务
            case "401010109":// 山东--文件下载
                templateCode = "SHANDONG";
                List<String> shandongList = new ArrayList<>();
                Map<String, String> shandongChangeList = new HashMap<>();
                shandongList.add("401010101");
                shandongList.add("401010102");
                shandongList.add("401010103");
                shandongList.add("401010104");
                shandongChangeList.put("401010104", "104010301");
                shandongList.add("401010105");
                shandongList.add("401010106");
                shandongList.add("401010107");
                shandongList.add("401010108");
                shandongList.add("401010109");
                map = disposeTemplateMap(6,null,null,shandongList,shandongChangeList);
                String shandongUrl = null;
                // 进行静态页生成方法调用
                try {
                    shandongUrl = templateComponent.createHtml3(templateCode, map);
                    log.info("静态文件生成成功，生成地址是={}", shandongUrl);
                } catch (IOException e){
                    log.error("静态文件生成失败，失败原因是={}", e.getMessage());
                }
                return shandongUrl;
//            case 501010101:
            case "601010101":// 辽宁--通知公告
            case "601010102":// 辽宁--工作动态
            case "601010103":// 辽宁--易找标
            case "601010104":// 辽宁--国家法规
            case "601010105":// 辽宁--地方法规
            case "601010106":// 辽宁--投诉处理结果
            case "601010107":// 辽宁--监督检查处理结果
            case "601010108":// 辽宁--不良行为
            case "601010109":// 辽宁--购买服务
            case "601010110":// 辽宁--办事指南
            case "601010111":// 辽宁--常见问题解答
            case "601010112":// 辽宁--文件下载
                templateCode = "LIAONING";
                List<String> liaoningList = new ArrayList<>();
                Map<String, String> liaoningChangeList = new HashMap<>();
                liaoningList.add("601010101");
                liaoningList.add("601010102");
                liaoningList.add("601010103");
                liaoningList.add("601010104");
                liaoningChangeList.put("601010104", "104010301");
                liaoningList.add("601010105");
                liaoningList.add("601010106");
                liaoningList.add("601010107");
                liaoningList.add("601010108");
                liaoningList.add("601010109");
                liaoningList.add("601010110");
                liaoningList.add("601010111");
                liaoningList.add("601010112");
                map = disposeTemplateMap(6,null,null,liaoningList,liaoningChangeList);
                String liaoningUrl = null;
                // 进行静态页生成方法调用
                try {
                    liaoningUrl = templateComponent.createHtml3(templateCode, map);
                    log.info("静态文件生成成功，生成地址是={}", liaoningUrl);
                } catch (IOException e){
                    log.error("静态文件生成失败，失败原因是={}", e.getMessage());
                }
                return liaoningUrl;
//            case 701010101:
//            case 801010101:
            case "901010101":
            case "901010102":
            case "901010103":
            case "901010104":
            case "901010105":
            case "901010106":
            case "901010107":
            case "901010108":
            case "901010109":
            case "901010110":
            case "901010111":
            case "901010112":
                templateCode = "JIANGSU";
                List<String> jiangsuList = new ArrayList<>();
                Map<String, String> jiangsuChangeList = new HashMap<>();
                jiangsuList.add("901010101");
                jiangsuList.add("901010102");
                jiangsuList.add("901010103");
                jiangsuList.add("901010104");
                jiangsuChangeList.put("901010104", "104010301");
                jiangsuList.add("901010105");
                jiangsuList.add("901010106");
                jiangsuList.add("901010107");
                jiangsuList.add("901010108");
                jiangsuList.add("901010109");
                jiangsuList.add("901010110");
                jiangsuList.add("901010111");
                jiangsuList.add("901010112");
                map = disposeTemplateMap(6,null,null,jiangsuList,jiangsuChangeList);
                String jiangsuUrl = null;
                // 进行静态页生成方法调用
                try {
                    jiangsuUrl = templateComponent.createHtml3(templateCode, map);
                    log.info("静态文件生成成功，生成地址是={}", jiangsuUrl);
                } catch (IOException e){
                    log.error("静态文件生成失败，失败原因是={}", e.getMessage());
                }
                return jiangsuUrl;
            case "1001010101":
            case "1001010102":
            case "1001010103":
            case "1001010104":
            case "1001010105":
            case "1001010106":
            case "1001010107":
            case "1001010108":
            case "1001010109":
                templateCode = "ZHEJIANG";
                List<String> zhejiangList = new ArrayList<>();
                Map<String, String> zhejiangChangeList = new HashMap<>();
                zhejiangList.add("1001010101");
                zhejiangList.add("1001010102");
                zhejiangList.add("1001010103");
                zhejiangList.add("1001010104");
                zhejiangChangeList.put("1001010104", "104010301");
                zhejiangList.add("1001010105");
                zhejiangList.add("1001010106");
                zhejiangList.add("1001010107");
                zhejiangList.add("1001010108");
                zhejiangList.add("1001010109");
                map = disposeTemplateMap(6,null,null,zhejiangList,zhejiangChangeList);
                String zhejiangUrl = null;
                // 进行静态页生成方法调用
                try {
                    zhejiangUrl = templateComponent.createHtml3(templateCode, map);
                    log.info("静态文件生成成功，生成地址是={}", zhejiangUrl);
                } catch (IOException e){
                    log.error("静态文件生成失败，失败原因是={}", e.getMessage());
                }
                return zhejiangUrl;
//            case 1101010101:
            case "1201010101":// 福建--通知公告
            case "1201010102":// 福建--工作动态
            case "1201010103":// 福建--易找标
            case "1201010104":// 福建--国家法规
            case "1201010105":// 福建--地方法规
            case "1201010106":// 福建--政策专区
            case "1201010107":// 福建--专项监督检查
            case "1201010108":// 福建--监管信息公告
            case "1201010109":// 福建--常见问题解答
            case "1201010110":// 福建--文件下载
                templateCode = "FUJIAN";
                List<String> fujianList = new ArrayList<>();
                Map<String, String> fujianChangeList = new HashMap<>();
                fujianList.add("1201010101");
                fujianList.add("1201010102");
                fujianList.add("1201010103");
                fujianList.add("1201010104");
                fujianChangeList.put("1201010104", "104010301");
                fujianList.add("1201010105");
                fujianList.add("1201010106");
                fujianList.add("1201010107");
                fujianList.add("1201010108");
                fujianList.add("1201010109");
                fujianList.add("1201010110");
                map = disposeTemplateMap(6,null,null,fujianList,fujianChangeList);
                String fujianUrl = null;
                // 进行静态页生成方法调用
                try {
                    fujianUrl = templateComponent.createHtml3(templateCode, map);
                    log.info("静态文件生成成功，生成地址是={}", fujianUrl);
                } catch (IOException e){
                    log.error("静态文件生成失败，失败原因是={}", e.getMessage());
                }
                return fujianUrl;
//            case 1301010101:
            case "1401010101":// 湖北--通知公告
            case "1401010102":// 湖北--工作动态
            case "1401010103":// 湖北--易找标
            case "1401010104":// 湖北--国家法规(监管--法律法规)
            case "1401010105":// 湖北--地方法规(监管--地方法规)
            case "1401010106":// 湖北--投诉处理结果(监管--投诉处理)
            case "1401010107":// 湖北--监督检查处理结果(监管--监督检查)
            case "1401010108":// 湖北--几种采购机构考核结果
            case "1401010109":// 湖北--一般处理处罚公告
            case "1401010110":// 湖北--严重违法失信公告
            case "1401010111":// 湖北--购买服务
            case "1401010112":// 湖北--办事指南
            case "1401010113":// 湖北--常见问题解答
            case "1401010114":// 湖北--文件下载
                templateCode = "HUBEI";
                List<String> hubeiList = new ArrayList<>();
                Map<String, String> hubeiChangeList = new HashMap<>();
                hubeiList.add("1401010101");
                hubeiList.add("1401010102");
                hubeiList.add("1401010103");
                hubeiList.add("1401010104");
                hubeiChangeList.put("1401010104", "104010301");
                hubeiList.add("1401010105");
                hubeiList.add("1401010106");
                hubeiList.add("1401010107");
                hubeiList.add("1401010108");
                hubeiList.add("1401010109");
                hubeiList.add("1401010110");
                hubeiList.add("1401010111");
                hubeiList.add("1401010112");
                hubeiList.add("1401010113");
                hubeiList.add("1401010114");
                map = disposeTemplateMap(6,null,null,hubeiList,hubeiChangeList);
                String hubeiUrl = null;
                // 进行静态页生成方法调用
                try {
                    hubeiUrl = templateComponent.createHtml3(templateCode, map);
                    log.info("静态文件生成成功，生成地址是={}", hubeiUrl);
                } catch (IOException e){
                    log.error("静态文件生成失败，失败原因是={}", e.getMessage());
                }
                return hubeiUrl;
//            case 1501010101:
//            case 1601010101:
            case "1701010101":// 海南--通知公告
            case "1701010102":// 海南--工作动态
            case "1701010103":// 海南--易找标
            case "1701010104":// 海南--国家法规
            case "1701010105":// 海南--地方法规
            case "1701010106":// 海南--政策专区
            case "1701010107":// 海南--投诉处理结果
            case "1701010108":// 海南--监督检查处理结果
            case "1701010109":// 海南--集中采购机构考核结果
            case "1701010110":// 海南--投诉联系方式
            case "1701010111":// 海南--购买服务
            case "1701010112":// 海南--办事指南
            case "1701010113":// 海南--常见问题解答
                templateCode = "HAINAN";
                List<String> hainanList = new ArrayList<>();
                Map<String, String> hainanChangeList = new HashMap<>();
                hainanList.add("1701010101");
                hainanList.add("1701010102");
                hainanList.add("1701010103");
                hainanList.add("1701010104");
                hainanChangeList.put("1701010104", "104010301");
                hainanList.add("1701010105");
                hainanList.add("1701010106");
                hainanList.add("1701010107");
                hainanList.add("1701010108");
                hainanList.add("1701010109");
                hainanList.add("1701010110");
                hainanList.add("1701010111");
                hainanList.add("1701010112");
                hainanList.add("1701010113");
                map = disposeTemplateMap(6,null,null,hainanList,hainanChangeList);
                String hainanUrl = null;
                // 进行静态页生成方法调用
                try {
                    hainanUrl = templateComponent.createHtml3(templateCode, map);
                    log.info("静态文件生成成功，生成地址是={}", hainanUrl);
                } catch (IOException e){
                    log.error("静态文件生成失败，失败原因是={}", e.getMessage());
                }
                return hainanUrl;
//            case 1801010101:
            case "1901010101":
            case "1901010102":
            case "1901010103":
            case "1901010104":
            case "1901010105":
            case "1901010106":
            case "1901010107":
            case "1901010108":
            case "1901010109":
                templateCode = "GUIZHOU";
                List<String> guizhouList = new ArrayList<>();
                Map<String, String> guizhouChangeList = new HashMap<>();
                guizhouList.add("1901010101");
                guizhouList.add("1901010102");
                guizhouList.add("1901010103");
                guizhouList.add("1901010104");
                guizhouChangeList.put("1901010104", "104010301");
                guizhouList.add("1901010105");
                guizhouList.add("1901010106");
                guizhouList.add("1901010107");
                guizhouList.add("1901010108");
                guizhouList.add("1901010109");
                map = disposeTemplateMap(6,null,null,guizhouList,guizhouChangeList);
                String guizhouUrl = null;
                // 进行静态页生成方法调用
                try {
                    guizhouUrl = templateComponent.createHtml3(templateCode, map);
                    log.info("静态文件生成成功，生成地址是={}", guizhouUrl);
                } catch (IOException e){
                    log.error("静态文件生成失败，失败原因是={}", e.getMessage());
                }
                return guizhouUrl;
            case "2001010101":
            case "2001010102":
            case "2001010103":
            case "2001010104":
            case "2001010105":
            case "2001010106":
            case "2001010107":
            case "2001010108":
            case "2001010109":
            case "2001010110":
            case "2001010111":
                templateCode = "YUNNAN";
                List<String> yunnanList = new ArrayList<>();
                Map<String, String> yunnanChangeList = new HashMap<>();
                yunnanList.add("2001010101");
                yunnanList.add("2001010102");
                yunnanList.add("2001010103");
                yunnanList.add("2001010104");
                yunnanChangeList.put("2001010104", "104010301");
                yunnanList.add("2001010105");
                yunnanList.add("2001010106");
                yunnanList.add("2001010107");
                yunnanList.add("2001010108");
                yunnanList.add("2001010109");
                yunnanList.add("2001010110");
                yunnanList.add("2001010111");
                map = disposeTemplateMap(6,null,null,yunnanList,yunnanChangeList);
                String yunnanUrl = null;
                // 进行静态页生成方法调用
                try {
                    yunnanUrl = templateComponent.createHtml3(templateCode, map);
                    log.info("静态文件生成成功，生成地址是={}", yunnanUrl);
                } catch (IOException e){
                    log.error("静态文件生成失败，失败原因是={}", e.getMessage());
                }
                return yunnanUrl;
            case "2101010101":
            case "2101010102":
            case "2101010103":
            case "2101010104":
            case "2101010105":
            case "2101010106":
            case "2101010107":
            case "2101010108":
            case "2101010109":
            case "2101010110":
            case "2101010111":
                templateCode = "SHAANXI";
                List<String> shaanxiList = new ArrayList<>();
                Map<String, String> shaanxiChangeList = new HashMap<>();
                shaanxiList.add("2101010101");
                shaanxiList.add("2101010102");
                shaanxiList.add("2101010103");
                shaanxiList.add("2101010104");
                shaanxiChangeList.put("2101010104", "104010301");
                shaanxiList.add("2101010105");
                shaanxiList.add("2101010106");
                shaanxiList.add("2101010107");
                shaanxiList.add("2101010108");
                shaanxiList.add("2101010109");
                shaanxiList.add("2101010110");
                shaanxiList.add("2101010111");
                map = disposeTemplateMap(6,null,null,shaanxiList,shaanxiChangeList);
                String shaanxiUrl = null;
                // 进行静态页生成方法调用
                try {
                    shaanxiUrl = templateComponent.createHtml3(templateCode, map);
                    log.info("静态文件生成成功，生成地址是={}", shaanxiUrl);
                } catch (IOException e){
                    log.error("静态文件生成失败，失败原因是={}", e.getMessage());
                }
                return shaanxiUrl;
            case "2201010101":
            case "2201010102":
            case "2201010103":
            case "2201010104":
            case "2201010105":
            case "2201010106":
            case "2201010107":
            case "2201010108":
                templateCode = "GANSU";
                List<String> gansuList = new ArrayList<>();
                Map<String, String> gansuChangeList = new HashMap<>();
                gansuList.add("2201010101");
                gansuList.add("2201010102");
                gansuList.add("2201010103");
                gansuList.add("2201010104");
                gansuChangeList.put("2201010104", "104010301");
                gansuList.add("2201010105");
                gansuList.add("2201010106");
                gansuList.add("2201010107");
                gansuList.add("2201010108");
                map = disposeTemplateMap(6,null,null,gansuList,gansuChangeList);
                String gansuUrl = null;
                // 进行静态页生成方法调用
                try {
                    gansuUrl = templateComponent.createHtml3(templateCode, map);
                    log.info("静态文件生成成功，生成地址是={}", gansuUrl);
                } catch (IOException e){
                    log.error("静态文件生成失败，失败原因是={}", e.getMessage());
                }
                return gansuUrl;
//            case 2301010101:
            case "2401010101":
            case "2401010102":
            case "2401010103":
            case "2401010104":
            case "2401010105":
            case "2401010106":
            case "2401010107":
            case "2401010108":
            case "2401010109":
            case "2401010110":
                templateCode = "BEIJING";
                List<String> bejingList = new ArrayList<>();
                Map<String, String> beijingChangeList = new HashMap<>();
                bejingList.add("2401010101");
                bejingList.add("2401010102");
                bejingList.add("2401010103");
                bejingList.add("2401010104");
                beijingChangeList.put("2401010104", "104010301");
                bejingList.add("2401010105");
                bejingList.add("2401010106");
                bejingList.add("2401010107");
                bejingList.add("2401010108");
                bejingList.add("2401010109");
                bejingList.add("2401010110");
                map = disposeTemplateMap(6,null,null,bejingList,beijingChangeList);
                String beijingUrl = null;
                // 进行静态页生成方法调用
                try {
                    beijingUrl = templateComponent.createHtml3(templateCode, map);
                    log.info("静态文件生成成功，生成地址是={}", beijingUrl);
                } catch (IOException e){
                    log.error("静态文件生成失败，失败原因是={}", e.getMessage());
                }
                return beijingUrl;
            case "2501010101":
            case "2501010102":
            case "2501010103":
            case "2501010104":
            case "2501010105":
            case "2501010106":
            case "2501010107":
            case "2501010108":
            case "2501010109":
                templateCode = "TIANJIN";
                List<String> tianjinList = new ArrayList<>();
                Map<String, String> tianjinChangeList = new HashMap<>();
                tianjinList.add("2501010101");
                tianjinList.add("2501010102");
                tianjinList.add("2501010103");
                tianjinList.add("2501010104");
                tianjinChangeList.put("2501010104", "104010301");
                tianjinList.add("2501010105");
                tianjinList.add("2501010106");
                tianjinList.add("2501010107");
                tianjinList.add("2501010108");
                tianjinList.add("2501010109");
                map = disposeTemplateMap(6,null,null,tianjinList,tianjinChangeList);
                String tianjinUrl = null;
                // 进行静态页生成方法调用
                try {
                    tianjinUrl = templateComponent.createHtml3(templateCode, map);
                    log.info("静态文件生成成功，生成地址是={}", tianjinUrl);
                } catch (IOException e){
                    log.error("静态文件生成失败，失败原因是={}", e.getMessage());
                }
                return tianjinUrl;
            case "2601010101":
            case "2601010102":
            case "2601010103":
            case "2601010104":
            case "2601010105":
            case "2601010106":
            case "2601010107":
            case "2601010108":
            case "2601010109":
                templateCode = "CHONGQING";
                List<String> chongqingList = new ArrayList<>();
                Map<String, String> chongqingChangeList = new HashMap<>();
                chongqingList.add("2601010101");
                chongqingList.add("2601010102");
                chongqingList.add("2601010103");
                chongqingList.add("2601010104");
                chongqingChangeList.put("2601010104", "104010301");
                chongqingList.add("2601010105");
                chongqingList.add("2601010106");
                chongqingList.add("2601010107");
                chongqingList.add("2601010108");
                chongqingList.add("2601010109");
                map = disposeTemplateMap(6,null,null,chongqingList,chongqingChangeList);
                String chongqingUrl = null;
                // 进行静态页生成方法调用
                try {
                    chongqingUrl = templateComponent.createHtml3(templateCode, map);
                    log.info("静态文件生成成功，生成地址是={}", chongqingUrl);
                } catch (IOException e){
                    log.error("静态文件生成失败，失败原因是={}", e.getMessage());
                }
                return chongqingUrl;
//            case 2701010101:
            case "2801010101":
            case "2801010102":
            case "2801010103":
            case "2801010104":
            case "2801010105":
            case "2801010106":
            case "2801010107":
            case "2801010108":
                templateCode = "NEIMENGGU";
                List<String> neimengguList = new ArrayList<>();
                Map<String, String> neimengguChangeList = new HashMap<>();
                neimengguList.add("2801010101");
                neimengguList.add("2801010102");
                neimengguList.add("2801010103");
                neimengguChangeList.put("2801010103", "104010301");
                neimengguList.add("2801010104");
                neimengguList.add("2801010105");
                neimengguList.add("2801010106");
                neimengguList.add("2801010107");
                neimengguList.add("2801010108");
                map = disposeTemplateMap(6,null,null,neimengguList,neimengguChangeList);
                String neimengguUrl = null;
                // 进行静态页生成方法调用
                try {
                    neimengguUrl = templateComponent.createHtml3(templateCode, map);
                    log.info("静态文件生成成功，生成地址是={}", neimengguUrl);
                } catch (IOException e){
                    log.error("静态文件生成失败，失败原因是={}", e.getMessage());
                }
                return neimengguUrl;
            case "2901010101":
            case "2901010102":
            case "2901010103":
            case "2901010104":
            case "2901010105":
            case "2901010106":
            case "2901010107":
            case "2901010108":
            case "2901010109":
            case "2901010110":
            case "2901010111":
            case "2901010112":
            case "2901010113":
                templateCode = "GUANGXI";
                List<String> guangxiList = new ArrayList<>();
                Map<String, String> guangxiChangeList = new HashMap<>();
                guangxiList.add("2901010101");
                guangxiList.add("2901010102");
                guangxiList.add("2901010103");
                guangxiList.add("2901010104");
                guangxiChangeList.put("2901010104", "104010301");
                guangxiList.add("2901010105");
                guangxiList.add("2901010106");
                guangxiList.add("2901010107");
                guangxiList.add("2901010108");
                guangxiList.add("2901010109");
                guangxiList.add("2901010110");
                guangxiList.add("2901010111");
                guangxiList.add("2901010112");
                guangxiList.add("2901010113");
                map = disposeTemplateMap(6,null,null,guangxiList,guangxiChangeList);
                String guangxiUrl = null;
                // 进行静态页生成方法调用
                try {
                    guangxiUrl = templateComponent.createHtml3(templateCode, map);
                    log.info("静态文件生成成功，生成地址是={}", guangxiUrl);
                } catch (IOException e){
                    log.error("静态文件生成失败，失败原因是={}", e.getMessage());
                }
                return guangxiUrl;
            case "3001010101":
            case "3001010102":
            case "3001010103":
            case "3001010104":
            case "3001010105":
            case "3001010106":
            case "3001010107":
            case "3001010108":
            case "3001010109":
            case "3001010110":
            case "3001010111":
                templateCode = "NINGXIA";
                List<String> ningxiaList = new ArrayList<>();
                Map<String, String> ningxiaChangeList = new HashMap<>();
                ningxiaList.add("3001010101");
                ningxiaList.add("3001010102");
                ningxiaList.add("3001010103");
                ningxiaList.add("3001010104");
                ningxiaChangeList.put("3001010104", "104010301");
                ningxiaList.add("3001010105");
                ningxiaList.add("3001010106");
                ningxiaList.add("3001010107");
                ningxiaList.add("3001010108");
                ningxiaList.add("3001010109");
                ningxiaList.add("3001010110");
                ningxiaList.add("3001010111");
                map = disposeTemplateMap(6,null,null,ningxiaList,ningxiaChangeList);
                String ningxiaUrl = null;
                // 进行静态页生成方法调用
                try {
                    ningxiaUrl = templateComponent.createHtml3(templateCode, map);
                    log.info("静态文件生成成功，生成地址是={}", ningxiaUrl);
                } catch (IOException e){
                    log.error("静态文件生成失败，失败原因是={}", e.getMessage());
                }
                return ningxiaUrl;
            case "3101010101":
            case "3101010102":
            case "3101010103":
            case "3101010104":
            case "3101010105":
            case "3101010106":
            case "3101010107":
            case "3101010108":
            case "3101010109":
            case "3101010110":
            case "3101010111":
            case "3101010112":
                templateCode = "XINJIANG";
                List<String> xinjiangList = new ArrayList<>();
                Map<String, String> xinjiangChangeList = new HashMap<>();
                xinjiangList.add("3101010101");
                xinjiangList.add("3101010102");
                xinjiangList.add("3101010103");
                xinjiangList.add("3101010104");
                xinjiangChangeList.put("3101010104", "104010301");
                xinjiangList.add("3101010105");
                xinjiangList.add("3101010106");
                xinjiangList.add("3101010107");
                xinjiangList.add("3101010108");
                xinjiangList.add("3101010109");
                xinjiangList.add("3101010110");
                xinjiangList.add("3101010111");
                xinjiangList.add("3101010112");
                map = disposeTemplateMap(6,null,null,xinjiangList,xinjiangChangeList);
                String xinjiangUrl = null;
                // 进行静态页生成方法调用
                try {
                    xinjiangUrl = templateComponent.createHtml3(templateCode, map);
                    log.info("静态文件生成成功，生成地址是={}", xinjiangUrl);
                } catch (IOException e){
                    log.error("静态文件生成失败，失败原因是={}", e.getMessage());
                }
                return xinjiangUrl;
            case "3201010101":
            case "3201010102":
            case "3201010103":
            case "3201010104":
            case "3201010105":
            case "3201010106":
            case "3201010107":
                templateCode = "XIZANG";
                List<String> xizangList = new ArrayList<>();
                Map<String, String> xizangChangeList = new HashMap<>();
                xizangList.add("3201010101");
                xizangList.add("3201010102");
                xizangList.add("3201010103");
                xizangList.add("3201010104");
                xizangChangeList.put("3201010104", "104010301");
                xizangList.add("3201010105");
                xizangList.add("3201010106");
                xizangList.add("3201010107");
                map = disposeTemplateMap(6,null,null,xizangList,xizangChangeList);
                String xizangUrl = null;
                // 进行静态页生成方法调用
                try {
                    xizangUrl = templateComponent.createHtml3(templateCode, map);
                    log.info("静态文件生成成功，生成地址是={}", xizangUrl);
                } catch (IOException e){
                    log.error("静态文件生成失败，失败原因是={}", e.getMessage());
                }
                return xizangUrl;
            case "3301010101":
            case "3301010102":
            case "3301010103":
            case "3301010104":
            case "3301010105":
            case "3301010106":
            case "3301010107":
            case "3301010108":
            case "3301010109":
            case "3301010110":
            case "3301010111":
            case "3301010112":
                templateCode = "BINGTUAN";
                List<String> bingtuanList = new ArrayList<>();
                Map<String, String> bingtuanChangeList = new HashMap<>();
                bingtuanList.add("3301010101");
                bingtuanList.add("3301010102");
                bingtuanList.add("3301010103");
                bingtuanList.add("3301010104");
                bingtuanChangeList.put("3301010104", "104010301");
                bingtuanList.add("3301010105");
                bingtuanList.add("3301010106");
                bingtuanList.add("3301010107");
                bingtuanList.add("3301010108");
                bingtuanList.add("3301010109");
                bingtuanList.add("3301010110");
                bingtuanList.add("3301010111");
                bingtuanList.add("3301010112");
                map = disposeTemplateMap(6,null,null,bingtuanList,bingtuanChangeList);
                String bingtuanUrl = null;
                // 进行静态页生成方法调用
                try {
                    bingtuanUrl = templateComponent.createHtml3(templateCode, map);
                    log.info("静态文件生成成功，生成地址是={}", bingtuanUrl);
                } catch (IOException e){
                    log.error("静态文件生成失败，失败原因是={}", e.getMessage());
                }
                return bingtuanUrl;
            case "3401010101":
            case "3401010102":
            case "3401010103":
            case "3401010104":
            case "3401010105":
            case "3401010106":
            case "3401010107":
            case "3401010108":
            case "3401010109":
                templateCode = "DALIAN";
                List<String> dalianList = new ArrayList<>();
                Map<String, String> dalianChangeList = new HashMap<>();
                dalianList.add("3401010101");
                dalianList.add("3401010102");
                dalianList.add("3401010103");
                dalianList.add("3401010104");
                dalianChangeList.put("3401010104", "104010301");
                dalianList.add("3401010105");
                dalianList.add("3401010106");
                dalianList.add("3401010107");
                dalianList.add("3401010108");
                dalianList.add("3401010109");
                map = disposeTemplateMap(6,null,null,dalianList,dalianChangeList);
                String dalianUrl = null;
                // 进行静态页生成方法调用
                try {
                    dalianUrl = templateComponent.createHtml3(templateCode, map);
                    log.info("静态文件生成成功，生成地址是={}", dalianUrl);
                } catch (IOException e){
                    log.error("静态文件生成失败，失败原因是={}", e.getMessage());
                }
                return dalianUrl;
            case "3501010101":
            case "3501010102":
            case "3501010103":
            case "3501010104":
            case "3501010105":
            case "3501010106":
            case "3501010107":
            case "3501010108":
            case "3501010109":
                templateCode = "QINGDAO";
                List<String> qingdaoList = new ArrayList<>();
                Map<String, String> qingdaoChangeList = new HashMap<>();
                qingdaoList.add("3501010101");
                qingdaoList.add("3501010102");
                qingdaoList.add("3501010103");
                qingdaoList.add("3501010104");
                qingdaoChangeList.put("3501010104", "104010301");
                qingdaoList.add("3501010105");
                qingdaoList.add("3501010106");
                qingdaoList.add("3501010107");
                qingdaoList.add("3501010108");
                qingdaoList.add("3501010109");
                map = disposeTemplateMap(6,null,null,qingdaoList,qingdaoChangeList);
                String qingdaoUrl = null;
                // 进行静态页生成方法调用
                try {
                    qingdaoUrl = templateComponent.createHtml3(templateCode, map);
                    log.info("静态文件生成成功，生成地址是={}", qingdaoUrl);
                } catch (IOException e){
                    log.error("静态文件生成失败，失败原因是={}", e.getMessage());
                }
                return qingdaoUrl;
//            case 3601010101:
//            case 3701010101:
            case "3801010101":
            case "3801010102":
            case "3801010103":
            case "3801010104":
            case "3801010105":
            case "3801010106":
            case "3801010107":
            case "3801010108":
            case "3801010109":
            case "3801010110":
            case "3801010111":
            case "3801010112":
                templateCode = "SHENZHEN";
                List<String> shenzhenList = new ArrayList<>();
                Map<String, String> shenzhenChangeList = new HashMap<>();
                shenzhenList.add("3801010101");
                shenzhenList.add("3801010102");
                shenzhenList.add("3801010103");
                shenzhenList.add("3801010104");
                shenzhenChangeList.put("3801010104", "104010301");
                shenzhenList.add("3801010105");
                shenzhenList.add("3801010106");
                shenzhenList.add("3801010107");
                shenzhenList.add("3801010108");
                shenzhenList.add("3801010109");
                shenzhenList.add("3801010110");
                shenzhenList.add("3801010111");
                shenzhenList.add("3801010112");
                map = disposeTemplateMap(6,null,null,shenzhenList,shenzhenChangeList);
                String shenzhenUrl = null;
                // 进行静态页生成方法调用
                try {
                    shenzhenUrl = templateComponent.createHtml3(templateCode, map);
                    log.info("静态文件生成成功，生成地址是={}", shenzhenUrl);
                } catch (IOException e){
                    log.error("静态文件生成失败，失败原因是={}", e.getMessage());
                }
                return shenzhenUrl;
        }

        // 拦截一下不在碎片处理范围内的调用
        if (templateCode.equals("")) return "";
        String url = null;
        // 进行静态页生成方法调用
        try {
            url = templateComponent.createHtml(templateCode, map);
            log.error("静态文件生成成功，生成地址是={}", url);
        } catch (IOException e){
            log.error("静态文件生成失败，失败原因是={}", e.getMessage());
        }
        return url;
    }
    // 频道配置修改--更新静态页(首页)数据
    public String buildHomePageConfigHtml(String plateId){
        String templateCode = "";// 模板编号
        switch (plateId){
            case "100":// 全局设置
                break;
            case "101":// 网站首页
                templateCode = "HOME";
                break;
            case "102":// 采购人
                templateCode = "PURCHASER";
                break;
            case "103":// 采购实务
                templateCode = "PRACTICE";
                break;
            case "104":// 监管
                templateCode = "SUPERVISE";
                break;
            case "105":// 研究院
                templateCode = "INSTITUTE";
                break;
            case "106":// 军队
                templateCode = "ARMY";
                break;
            case "107":// 汽车
                templateCode = "AUTOMOBILE";
                break;
            case "108":// it
                templateCode = "IT";
                break;
            case "109":// 电梯
                templateCode = "ELEVATOR";
                break;
            case "110":// 空调
                templateCode = "CONDITIONER";
                break;
            case "111":// 家具
                templateCode = "FURNITURE";
                break;
            case "112"://政采榜
                templateCode = "GOVPROLIST";
                break;
            case "201":
                buildHomePageHtml("201010101");
                break;
            case "301":
                buildHomePageHtml("301010101");
                break;
            case "401":
                buildHomePageHtml("401010101");
                break;
//            case 501:
            case "601":
                buildHomePageHtml("601010101");
                break;
//            case 701:
//            case 801:
            case "901":
                buildHomePageHtml("901010101");
                break;
            case "1001":
                buildHomePageHtml("1001010101");
                break;
//            case 1101:
            case "1201":
                buildHomePageHtml("1201010101");
                break;
//            case 1301:
            case "1401":
                buildHomePageHtml("1401010101");
                break;
//            case 1501:
//            case 1601:
            case "1701":
                buildHomePageHtml("1701010101");
                break;
//            case 1801:
            case "1901":
                buildHomePageHtml("1901010101");
                break;
            case "2001":
                buildHomePageHtml("2001010101");
                break;
            case "2101":
                buildHomePageHtml("2101010101");
                break;
            case "2201":
                buildHomePageHtml("2201010101");
                break;
//            case 2301:
            case "2401":
                buildHomePageHtml("2401010101");
                break;
            case "2501":
                buildHomePageHtml("2501010101");
                break;
            case "2601":
                buildHomePageHtml("2601010101");
                break;
//            case 2701:
            case "2801":
                buildHomePageHtml("2801010101");
                break;
            case "2901":
                buildHomePageHtml("2901010101");
                break;
            case "3001":
                buildHomePageHtml("3001010101");
                break;
            case "3101":
                buildHomePageHtml("3101010101");
                break;
            case "3201":
                buildHomePageHtml("3201010101");
                break;
            case "3301":
                buildHomePageHtml("3301010101");
                break;
            case "3401":
                buildHomePageHtml("3401010101");
                break;
            case "3501":
                buildHomePageHtml("3501010101");
                break;
//            case 3601:
//            case 3701:
            case "3801":
                buildHomePageHtml("3801010101");
                break;
        }
        Map<String, Object> map = new HashMap<>();// 模板数据
        // 获取频道配置信息
        Channel channel = channelMapper.loadChannelByPlate(plateId);
        map.put("channelSite", channel.getChannelSite());
        map.put("channelSiteUrl", channel.getChannelSiteUrl());
        map.put("channel", channel);
        String url = null;
        // 进行静态页生成方法调用
        if (!templateCode.equals("")){
            try {
                url = templateComponent.createHtml3(templateCode, map);
                log.error("静态文件生成成功，生成地址是={}", url);
            } catch (IOException e){
                log.error("静态文件生成失败，失败原因是={}", e.getMessage());
            }
        }
        return url;
    }

    // 频道配置修改--官微
    public String buildHomePageHibuick(String plateId) {
        String templateCode = "";// 模板编号
        switch (plateId){
            case "100":// 全局设置
                break;
            case "101":// 网站首页
                templateCode = "HOMEFRAGMENTHIBUICK";
                break;
            case "102":// 采购人
                templateCode = "PURCHASERFRAGMENTHIBUICK";
                break;
            case "103":// 采购实务
                templateCode = "PRACTICEFRAGMENTARTICLEHIBUICK";
                break;
            case "104":// 监管
                templateCode = "SUPERVISEFRAGMENTARTICLEHIBUICK";
                break;
            case "105":// 研究院
                templateCode = "INSTITUTEFRAGMENTARTICLEHIBUICK";
                break;
            case "106":// 军队
                templateCode = "ARMYFRAGMENTHIBUICK";
                break;
            case "107":// 汽车
                templateCode = "AUTOFRAGMENTHIBUICK";
                break;
            case "108":// it
                templateCode = "ITFRAGMENTHIBUICK";
                break;
            case "109":// 电梯
                templateCode = "ELEVATORFRAGMENTHIBUICK";
                break;
            case "110":// 空调
                templateCode = "CONDITIONERFRAGMENTHIBUICK";
                break;
            case "111":// 家具
                templateCode = "FURNITUREFRAGMENTHIBUICK";
                break;
        }
        Map<String, Object> map = new HashMap<>();// 模板数据
        // 获取频道配置信息
        Channel channel = channelMapper.loadChannelByPlate(plateId);
        map.put("channel", channel);
        String url = null;
        // 进行静态页生成方法调用
        if (!templateCode.equals("")){
            try {
                url = templateComponent.createHtml(templateCode, map);
                log.error("静态文件生成成功，生成地址是={}", url);
            } catch (IOException e){
                log.error("静态文件生成失败，失败原因是={}", e.getMessage());
            }
        }
        return url;
    }

    // 频道配置修改--左侧菜单栏
    public void buildHomePageLeftMenu(String plateId) {
        String templateCode = "";// 模板编号
        switch (plateId){
            case "100":// 全局设置
                break;
            case "101":// 网站首页
                templateCode = "HOMEFRAGMENTHIBUICK";
                break;
            case "102":// 采购人
                templateCode = "PURCHASERFRAGMENTHIBUICK";
                break;
            case "103":// 采购实务
                templateCode = "PRACTICEFRAGMENTLEFTMENU";
                break;
            case "104":// 监管
                templateCode = "SUPERVISEFRAGMENTHIBUICK";
                break;
            case "105":// 研究院
                templateCode = "INSTITUTEFRAGMENTARTICLEHIBUICK";
                break;
            case "106":// 军队
                templateCode = "ARMYFRAGMENTHIBUICK";
                break;
            case "107":// 汽车
                templateCode = "AUTOFRAGMENTHIBUICK";
                break;
            case "108":// it
                templateCode = "ITFRAGMENTHIBUICK";
                break;
            case "109":// 电梯
                templateCode = "ELEVATORFRAGMENTHIBUICK";
                break;
            case "110":// 空调
                templateCode = "CONDITIONERFRAGMENTHIBUICK";
                break;
            case "111":// 家具
                templateCode = "FURNITUREFRAGMENTHIBUICK";
                break;
        }
        Map<String, Object> map = new HashMap<>();// 模板数据
        // 获取频道配置信息
        Channel channel = channelMapper.loadChannelByPlate(plateId);
        map.put("channel", channel);
        // 进行静态页生成方法调用
        if (!templateCode.equals("")){
            try {
                templateComponent.createHtml(templateCode, map);
            } catch (IOException e){
                log.error("静态文件生成失败，失败原因是={}", e.getMessage());
            }
        }
    }

    // 频道配置修改--左侧LOGO栏目
    public void buildHomePageLeftLogo(String plateId){
        String templateCode = "";// 模板编号
        switch (plateId){
            case "102":// 采购人
                templateCode = "PURCHASERFRAGMENTLEFTLOGO";
                break;
            case "103":// 采购实务
                templateCode = "PRACTICEFRAGMENTLEFTLOGO";
                break;
            case "104":// 监管
                templateCode = "SUPERVISEFRAGMENTLEFTLOGO";
                break;
            case "105":// 研究院
                templateCode = "INSTITUTEFRAGMENTLEFTLOGO";
                break;
            case "106":// 军队
                templateCode = "ARMYFRAGMENTLEFTLOGO";
                break;
        }
        Map<String, Object> map = new HashMap<>();// 模板数据
        // 获取频道配置信息
        Channel channel = channelMapper.loadChannelByPlate(plateId);
        map.put("channel", channel);
        // 进行静态页生成方法调用
        if (!templateCode.equals("")){
            try {
                templateComponent.createHtml(templateCode, map);
            } catch (IOException e){
                log.error("静态文件生成失败，失败原因是={}", e.getMessage());
            }
        }
    }


    /**
     * 统一处理列表数据(获取对应标题列表、关键词列表)
     * @param list  数据列表
     * @return 处理后的数据列表
     */
    private List<ChannelDataTemplate> disposeChannelDataList(List<ChannelDataTemplate> list, Integer titleType){
        for (ChannelDataTemplate info: list){
            // 遍历列表获取对应标题类型列表
            ArticleTitle articleTitle = articleTitleMapper.loadArticleTitle(info.getArticleId(),titleType);
            if (null != articleTitle){
                info.setArticleTitle(articleTitle.getArticleTitle());
                info.setArticleTitleImage(articleTitle.getArticleImage());
                info.setArticleTitleImageAlt(articleTitle.getArticleImageAlt());
            }
            // 遍历列表获取对应的关键词列表
            List<ArticleKeywordTemplate> articleKeyWordList = new ArrayList<>();
            if (!info.getArticleKeyWord().equals("")){
                String[] articleKeyword = info.getArticleKeyWord().split(",");
                for (String word: articleKeyword){
                    ArticleKeyword keyword = articleKeywordMapper.selectByPrimaryKey(Integer.valueOf(word));
                    if (null != keyword){
                        ArticleKeywordTemplate keyWord = new ArticleKeywordTemplate();
                        keyWord.setId(keyword.getId());
                        keyWord.setKeyword(keyword.getKeyword());
                        articleKeyWordList.add(keyWord);
                    }
                }
            }
            info.setArticleKeyWordList(articleKeyWordList);
            // 如果文章类型为产品类型获取产品信息数据
            if (info.getArticleType() == 7){
                ArticleProductData articleProduct = articleProductMapper.loadArticleProductData(info.getArticleId());
                if (null != articleProduct){
                    info.setProductName(articleProduct.getProductName());
                    info.setProductPrice(articleProduct.getProductPrice());
                    info.setProductModel(articleProduct.getProductModel());
                    info.setProductPurpose(articleProduct.getProductPurpose());
                    info.setProductImage(articleProduct.getProductImage());
                }
            }
            // 如果文章类型为图书类型获取图书信息数据
            if (info.getArticleType() == 8){
                ArticleBookData articleBook = articleBookMapper.loadArticleBookData(info.getArticleId());
                if (null != articleBook){
                    info.setBookPrice(articleBook.getBookPrice());
                    info.setBookImage(articleBook.getBookImage());
                }
            } else if (info.getArticleType() == 6){
                ArticleAudioData articleAudio = articleAudioMapper.loadArticleAudioData(info.getArticleId());
                if (null != articleAudio){
                    info.setArticleAudioUrl(articleAudio.getAudioUrl());
                }
            }
        }
        return list;
    }

    /**
     * 统一处理模板存放数据
     * @param templateType  应用模板类型
     * @param plate         单频道类型频道编号
     * @param plateList     多频道类型频道编号集合体
     * @return  封装数据的MAP
     */
    private Map<String, Object> disposeTemplateMap(Integer templateType, String plate, List<String> plateList, List<String> plateStrList, Map<String, String> changeList) {
        Map<String, Object> map = new HashMap<>();
        map.put("domain", domain);
        map.put("domainJunDui",domainJunDui);
        map.put("domainQiChe",domainQiChe);
        map.put("domainIT",domainIT);
        map.put("domainKongTiao",domainKongTiao);
        map.put("domainDianTi",domainDianTi);
        map.put("domainJiaJu",domainJiaJu);
        map.put("yzbDomain", yzbDomain);
        map.put("domainHuBei", domainHuBei);
        map.put("domainHeNan", domainHeNan);
        map.put("domainLiaoNing", domainLiaoNing);
        map.put("domainFuJian", domainFuJian);
        map.put("domainHaiNan", domainHaiNan);
        map.put("domainHeBei", domainHeBei);
        map.put("domainShanDong", domainShanDong);
        map.put("domainJiangSu", domainJiangSu);
        map.put("domainShaanXi", domainShaanXi);
        map.put("domainBeiJing", domainBeiJing);
        map.put("domainZheJiang", domainZheJiang);
        map.put("domainYunNan", domainYunNan);
        map.put("domainGuiZhou", domainGuiZhou);
        map.put("domainChongQing", domainChongQing);
        map.put("domainTianJin", domainTianJin);
        map.put("domainShenZhen", domainShenZhen);
        map.put("domainQingDao", domainQingDao);
        map.put("domainDaLian", domainDaLian);
        map.put("domainXiZang", domainXiZang);
        map.put("domainXinJiang", domainXinJiang);
        map.put("domainNingXia", domainNingXia);
        map.put("domainGuangXi", domainGuangXi);
        map.put("domainNeiMengGu", domainNeiMengGu);
        map.put("domainGanSu", domainGanSu);
        map.put("domainBingTuan", domainBingTuan);
        switch (templateType) {
            case 1:// 行业频道正常类型(单频道+单频道列表)
            case 2:// 行业频道(图表数据)类型（数量翻倍）
            case 3:// 行业频道(图表数据)类型（数量三倍）
                Channel channel = channelMapper.loadChannelByPlate(plate);
                if ("101020501".equals(plate)){
                    // 如果更新首页人物观点--调用监管--人物观点
                    plate = "104010102";
                    channel.setChannelCount(3);
                } else if ("104010102".equals(plate)){
                    // 如果更新监管-人物观点--同步调用更新首页人物观点的逻辑
                    buildHomePageHtml("101020501");
                }
                List<ChannelDataTemplate> list = channelDataMapper.loadChannelDataByChannel(plate, channel.getChannelCount() * templateType);// 图表数据为配置数量的2被
                if (null != list) disposeChannelDataList(list, channel.getTitleType());
                map.put("list", list);
                map.put("channel", channel);
                break;
            case 4:// 行业频道特殊类型(要闻、专题、政策、解读、黑名单)多相同频道综合
                List<Channel> channelList = new ArrayList<>();
                // 页卡内容数据
                for (int i = 0; i < plateList.size(); i++) {
                    Channel plateChannel = channelMapper.loadChannelByPlate(plateList.get(i));
                    channelList.add(plateChannel);
                    List<ChannelDataTemplate> channelDataTemplateList = channelDataMapper.loadChannelDataByChannel(plateList.get(i), plateChannel.getChannelCount());
                    if (null != channelDataTemplateList) disposeChannelDataList(channelDataTemplateList, plateChannel.getTitleType());
                    map.put("list" + (i + 1), channelDataTemplateList);
                }
                map.put("channelList", channelList);
                break;
            case 5:// 处理实务热搜类型
                String plateId = plate.substring(0,3);
                List<ChannelHotSearch> channelHotSearchList = channelHotSearchMapper.loadChannelHotSearchData(plateId);
                Channel channel2 = channelMapper.loadChannelByPlate(plate);
                map.put("channelList", channelHotSearchList);
                map.put("channel", channel2);
                break;
            case 6:// 分站类型处理
                String index;
                if (plateStrList.get(0).length() > 9){
                    index = plateStrList.get(0).substring(0,4);
                } else {
                    index = plateStrList.get(0).substring(0,3);
                }
                Channel channel60 = channelMapper.loadChannelByPlate(index);

                List<Channel> channelList6 = new ArrayList<>();
                for (String info: plateStrList){
                    Channel channel6 = channelMapper.loadChannelByPlateStr(info);
                    List<ChannelDataTemplate> channelDataTemplate6;
                    if (null == changeList.get(info)){// 当前频道不需要切换数据
                        channelDataTemplate6 = channelDataMapper.loadChannelDataByChannelStr(info, channel6.getChannelCount());
                        if (null != channelDataTemplate6) disposeChannelDataList(channelDataTemplate6, channel6.getTitleType());
                    } else {// 当前频道需要切换为其它频道数据
                        channel6 = channelMapper.loadChannelByPlateStr(changeList.get(info));
                        channelDataTemplate6 = channelDataMapper.loadChannelDataByChannelStr(changeList.get(info), channel6.getChannelCount());
                        if (null != channelDataTemplate6) disposeChannelDataList(channelDataTemplate6, channelMapper.loadChannelByPlateStr(changeList.get(info)).getTitleType());
                        channel6.setChannelValue(changeList.get(info));
                    }
                    channel6.setData(channelDataTemplate6);
                    channelList6.add(channel6);
                }
                map.put("list", channelList6);
                map.put("channel", channel60);
                map.put("channelSite", channel60.getChannelSite());
                map.put("channelSiteUrl", channel60.getChannelSiteUrl());
                break;

        }
        return map;
    }

    public String buildGovProListHomePage(){
        //获取频道首页的标题、关键词、描述等信息
        Channel channel = channelMapper.getChannelByPlateId("112");//政采榜的channel-value是112
        String templateCode = "GOVPROLIST";
        Map<String, Object> map = new HashMap<>();// 模板数据
        // 获取频道配置信息
        map.put("channel", channel);
        String url = null;
        // 进行静态页生成方法调用
        try {
            url = templateComponent.createHtml(templateCode, map);
            log.info("政采榜首页静态文件生成成功，生成地址是={}", url);
        } catch (IOException e){
            log.error(e.getMessage(), e);
        }
        return url;
    }

    /**
     * 创建个人中心-我的收藏页面
     * @return
     */
    public String buildMyCollectionHtml(){
        String templateCode = "MYCOLLECTION";
        Map<String, Object> map = new HashMap<>();// 模板数据
        String url = null;
        try{
            url = templateComponent.createHtml(templateCode, map);
            log.info("个人中心-我的收藏静态文件生成成功，生成地址是={}", url);
        }catch (IOException e){
            log.error(e.getMessage(), e);
        }
        return url;
    }

    /**
     * 创建个人中心-我的评论页面
     * @return
     */
    public String buildMyCommentHtml(){
        String templateCode = "MYCOMMENT";
        Map<String, Object> map = new HashMap<>();// 模板数据
        String url = null;
        try{
            url = templateComponent.createHtml(templateCode, map);
            log.info("个人中心-我的评论静态文件生成成功，生成地址是={}", url);
        }catch (IOException e){
            log.error(e.getMessage(), e);
        }
        return url;
    }

    /**
     * 创建个人中心-消息中心页面
     * @return
     */
    public String buildMessageCenterHtml(){
        String templateCode = "MESSAGECENTER";
        Map<String, Object> map = new HashMap<>();// 模板数据
        String url = null;
        try{
            url = templateComponent.createHtml(templateCode, map);
            log.info("个人中心-消息中心静态文件生成成功，生成地址是={}", url);
        }catch (IOException e){
            log.error(e.getMessage(), e);
        }
        return url;
    }

    /**
     * 创建个人中心-消息中心-消息详情页面
     * @return
     */
    public String buildMessageDetailHtml(){
        String templateCode = "MESSAGEDETAIL";
        Map<String, Object> map = new HashMap<>();// 模板数据
        String url = null;
        try{
            url = templateComponent.createHtml(templateCode, map);
            log.info("个人中心-消息中心-消息详情静态文件生成成功，生成地址是={}", url);
        }catch (IOException e){
            log.error(e.getMessage(), e);
        }
        return url;
    }

    /**
     * 创建个人中心-账号设置页面
     * @return
     */
    public String buildAccountOptionsHtml(){
        String templateCode = "ACCOUNTOPTIONS";
        Map<String, Object> map = new HashMap<>();// 模板数据
        String url = null;
        try{
            url = templateComponent.createHtml(templateCode, map);
            log.info("个人中心-账号设置静态文件生成成功，生成地址是={}", url);
        }catch (IOException e){
            log.error(e.getMessage(), e);
        }
        return url;
    }

    public String buildBottomRSSHtml() {
        String templateCode = "RSS";
        Map<String, Object> map = new HashMap<>();// 模板数据
        String url = null;
        try{
            url = templateComponent.createHtml(templateCode, map);
            log.info("生成底层页-RSS订阅生成成功，生成地址是={}", url);
        }catch (IOException e){
            log.error(e.getMessage(), e);
        }
        return url;
    }

    public String buildBottomTagHtml() {

        String templateCode = "TAG";
        Map<String, Object> map = new HashMap<>();// 模板数据
        String url = null;
        try{
            url = templateComponent.createHtml(templateCode, map);
            log.info("生成底层页-TAG订阅生成成功，生成地址是={}", url);
        }catch (IOException e){
            log.error(e.getMessage(), e);
        }
        return url;

    }

    public String buildAtlasSpecialListHtml() {

        String templateCode = "ATLASSPECIALLIST";
        Map<String, Object> map = new HashMap<>();
        map.put("domain", domain);
        //获取网站首页的title、keyword、description
        String url = null;
        try{
            url = templateComponent.createHtml(templateCode, map);
            log.info("生成专题-图片专题列表成功，生成地址是={}", url);
        }catch (IOException e){
            log.error(e.getMessage(), e);
        }
        return url;
    }

    public String buildAudioSpecialListHtml() {
        String templateCode = "AUDIOSPECIALLIST";
        Map<String, Object> map = new HashMap<>();
        map.put("domain", domain);
        //获取网站首页的title、keyword、description
        String url = null;
        try{
            url = templateComponent.createHtml(templateCode, map);
            log.info("生成专题-音频专题列表成功，生成地址是={}", url);
        }catch (IOException e){
            log.error(e.getMessage(), e);
        }
        return url;

    }

    public String buildNewsSpecialListHtml() {
        String templateCode = "NEWSSPECIALLIST";
        Map<String, Object>map = new HashMap<>();
        map.put("domain", domain);
        String url = null;
        try{
            url = templateComponent.createHtml(templateCode, map);
            log.info("生成专题-资讯专题列表成功，生成地址是={}", url);
        }catch (IOException e){
            log.error(e.getMessage(), e);
        }
        return url;
    }

    public String buildSearchResultListHtml() {
        String templateCode = "SEARCHRESULTLIST";
        Map<String, Object> map = new HashMap<>();// 模板数据
        String url = null;
        try{
            url = templateComponent.createHtml(templateCode, map);
            log.info("生成搜索页-文章列表成功，生成地址是={}", url);
        }catch (IOException e){
            log.error(e.getMessage(), e);
        }
        return url;

    }

    public String buildCooperationHtml() {
        String templateCode = "COOPERATION";
        Map<String, Object> map = new HashMap<>();// 模板数据
        String url = null;
        try{
            url = templateComponent.createHtml(templateCode, map);
            log.info("生成-商务合作底层页面成功，生成地址是={}", url);
        }catch (IOException e){
            log.error(e.getMessage(), e);
        }
        return url;
    }

    public String buildReportHtml() {
        String templateCode = "REPORT";
        Map<String, Object> map = new HashMap<>();// 模板数据
        String url = null;
        try{
            url = templateComponent.createHtml(templateCode, map);
            log.info("生成-寻求报道底层页面，生成地址是={}", url);
        }catch (IOException e){
            log.error(e.getMessage(), e);
        }
        return url;

    }

    public String buildWebsiteMapHtml() {
        String templateCode = "WEBSITEMAP";
        Map<String, Object> map = new HashMap<>();// 模板数据
        map.put("domain", domain);
        map.put("domainJunDui",domainJunDui);
        map.put("domainQiChe",domainQiChe);
        map.put("domainIT",domainIT);
        map.put("domainKongTiao",domainKongTiao);
        map.put("domainDianTi",domainDianTi);
        map.put("domainJiaJu",domainJiaJu);
        map.put("yzbDomain",yzbDomain);
        String url = null;
        try{
            url = templateComponent.createHtml(templateCode, map);
            log.info("生成-网站地图底层页面，生成地址是={}", url);
        }catch (IOException e){
            log.error(e.getMessage(), e);
        }
        return url;
    }


    /**
     * 网站正在建设中页面生成功能
     * @return
     */
    public String buildBuildingHtml(){
        String templateCode = "BUILDING";
        Map<String, Object> map = new HashMap<>();// 模板数据
        String url = null;
        try{
            url = templateComponent.createHtml(templateCode, map);
            log.info("网站域名正在建设中静态文件生成成功，生成地址是={}", url);
        }catch (IOException e){
            log.error(e.getMessage(), e);
        }
        return url;
    }

    /**
     * 网站正在建设中页面生成功能
     * @return
     */
    public String buildLoginHtml(){
        String templateCode = "LOGIN";
        Map<String, Object> map = new HashMap<>();// 模板数据
        String url = null;
        List<FooterConfig> footerTextList = (List<FooterConfig>)footerConfigService.listFooterText().getData();
        FooterConfig footerImage = (FooterConfig)footerConfigService.getFooterImage().getData();
        map.put("footerImage", footerImage);
        map.put("footerTextList", footerTextList);
        try{
            url = templateComponent.createHtml(templateCode, map);
            log.info("网站登录静态文件生成成功，生成地址是={}", url);
        }catch (IOException e){
            log.error(e.getMessage(), e);
        }
        return url;
    }

    /**
     * 网站404页面生成功能
     * @return
     */
    public String build404Html(){
        String templateCode = "404";
        Map<String, Object> map = new HashMap<>();// 模板数据
        String url = null;
        try{
            url = templateComponent.createHtml(templateCode, map);
            log.info("网站404静态文件生成成功，生成地址是={}", url);
        }catch (IOException e){
            log.error(e.getMessage(), e);
        }
        return url;
    }

    /**
     * 创建“我要发布”页面
     * @return
     */
    public String buildPublishHtml(){
        String templateCode = "PUBLISH";
        Map<String, Object> map = new HashMap<>();// 模板数据
        String url = null;
        try{
            url = templateComponent.createHtml(templateCode, map);
            log.info("我要发布页面生成成功，生成地址是={}", url);
        }catch (IOException e){
            log.error(e.getMessage(), e);
        }
        return url;
    }


    /**
     * 创建”我要讲课“页面
     * @return
     */
    public String buildGiveLessonHtml(){
        String templateCode = "GIVELESSON";
        Map<String, Object> map = new HashMap<>();// 模板数据
        String url = null;
        try{
            url = templateComponent.createHtml(templateCode, map);
            log.info("我要讲课页面生成成功，templateCode={},生成地址是={}", templateCode, url);
        }catch (IOException e){
            log.error(e.getMessage(), e);
        }
        return url;
    }
}
